#include "jmetafunction.h"

namespace JXQ
{

size_t JFuncInfo::find(size_t classTypeId, const std::string& name)
{
	char buf[(sizeof(size_t)<<3) + 1] = "";
	sprintf(buf, "%zu",classTypeId);

	auto it = funcIdHash.find(name + "_-_-_" + buf);
	return it==funcIdHash.end()? 0 : it->second;
}

size_t JFuncInfo::find(const std::string &name)
{
	auto it = funcIdHash.find(name);
	return it==funcIdHash.end()? 0 : it->second;
}

std::string JFuncInfo::getInfo(size_t id)
{
	if( id == 0 )
		return "void";

	auto it = funcInfoHash.find(id);
	return it==funcInfoHash.end()? "void" : it->second;
}

JFuncInfo::FuncIdHash   JFuncInfo::funcIdHash;

JFuncInfo::FuncInfoHash JFuncInfo::funcInfoHash;


} //namespace JXQ
